import type { RouteRecordRaw } from 'vue-router'
import { $t } from '@/locales'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  // path: '/merchandiseControl',
  // component: () => import('@/views/MerchandiseControl/index.vue'),
  // name: 'MerchandiseControl',
  // meta: {
  //   // title: $t('route.tabbar'),
  //   title: '商品管理',
  //   icon: 'ic:outline-playlist-add-check-circle',
  //   singleMenu: true,
  // },
  path: '/merchandiseControl',
  component: Layout,
  redirect: '/merchandiseControl/index',
  name: 'MerchandiseControl',
  meta: {
    title: '商品管理',
    icon: 'ic:outline-playlist-add-check-circle',
  },
  children: [
    {
      path: 'index',
      name: 'merchandiseControlIndex',
      component: () => import('@/views/MerchandiseControl/index.vue'),
      meta: {
        title: '商品管理',
        menu: false,
        activeMenu: '/merchandiseControl',
      },
    },
    {
      path: 'detail',
      name: 'merchandiseControlDetail',
      component: () => import('@/views/MerchandiseControl/detail.vue'),
      meta: {
        title: '商品编辑',
        auth: ['permission.browse'],
        menu: false,
        activeMenu: '/merchandiseControl',
      },
    },
  ],
}

export default routes
